//
//  CHSSortViewController.m
//  ZXCategories_Example
//
//  Created by zhuxm2023 on 2024/8/1.
//  Copyright © 2024 海参. All rights reserved.
//

#import "CHSSortViewController.h"

@interface CHSSortViewController ()

@end

@implementation CHSSortViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = self.navTitle;

}



- (void)quickSort:(NSArray *)anArray{
//    NSArray *sortedArray = [anArray zx_quickSortUsingComparator:^NSComparisonResult(id  _Nonnull obj, id  _Nonnull key) {
//            NSComparisonResult result = [obj compare:key];
//            return result;
//    }];
}

- (void)shellSort:(NSArray *)anArray{
//    NSArray *sortedArray = [anArray zx_shellSort:0 usingComparator:^NSComparisonResult(id  _Nonnull obj1, id  _Nonnull obj2) {
//        return [obj1 compare:obj2];
//    }];
    
}

- (void)insetSort:(NSArray *)anArray{
//    NSArray *sortedArray = [anArray zx_insetSort:0 usingComparator:^NSComparisonResult(id  _Nonnull obj1, id  _Nonnull obj2) {
//        if ([obj1 isKindOfClass:[NSString class]]) {
//            return [obj1 compare:obj2 options:NSNumericSearch];
//        }
//        return [obj1 compare:obj2];
//    }];
}


NSInteger intSort(id num1, id num2, void *context)
{
    int v1 = [num1 intValue];
    int v2 = [num2 intValue];
    if (v1 < v2)
        return NSOrderedAscending;
    else if (v1 > v2)
        return NSOrderedDescending;
    else
        return NSOrderedSame;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
